package com.yzjs.localhost.controller.tNeusoftComplianceTesting;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.yzjs.common.enumeration.RequestMethod;
import com.yzjs.localhost.dto.TNeusoftComplianceTestingDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import com.yzjs.common.base.entity.PageInfo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yzjs.localhost.entity.tNeusoftComplianceTesting.TNeusoftComplianceTestingEntity;
import com.yzjs.localhost.service.tNeusoftComplianceTesting.TNeusoftComplianceTestingService;




/**
 * 合规性检测
 *
 * @author yuqiumin
 * @email sunlightcs@gmail.com
 * @date 2021-09-04 11:26:24
 */
@Api(tags = "合规性检测")
@RestController
@RequestMapping("tNeusoftComplianceTesting")
public class TNeusoftComplianceTestingController {
    @Autowired
    private TNeusoftComplianceTestingService tNeusoftComplianceTestingService;




    /**
     * 信息
     */
    @ApiOperation(value="详情信息" ,httpMethod =RequestMethod.GET )
    @RequestMapping("/getDetail")
    public TNeusoftComplianceTestingDTO info( @RequestParam(required = true)   Integer id) throws Exception {
        TNeusoftComplianceTestingEntity  query = new TNeusoftComplianceTestingEntity();
        query.setId(id);
        TNeusoftComplianceTestingDTO dto = tNeusoftComplianceTestingService.getDetail(query);
        return  dto ;
    }
    /**
    * 列表查询
    * @return
    */
    @ApiOperation(value="列表查询" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/list")
    public List<TNeusoftComplianceTestingEntity> List( @RequestBody TNeusoftComplianceTestingEntity tNeusoftComplianceTesting) {

        List<TNeusoftComplianceTestingEntity> tNeusoftComplianceTestings = tNeusoftComplianceTestingService.findList(tNeusoftComplianceTesting);
        return tNeusoftComplianceTestings;
    }


    /**
     * 分页查询
     * @param tNeusoftComplianceTesting
     * @return
     */
    @ApiOperation(value="分页查询" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/listPage")
    public PageInfo<TNeusoftComplianceTestingEntity> listPage(@RequestBody TNeusoftComplianceTestingEntity tNeusoftComplianceTesting) {
        List<TNeusoftComplianceTestingEntity> tNeusoftComplianceTestings  = tNeusoftComplianceTestingService.findList(tNeusoftComplianceTesting);
        return new PageInfo<>(tNeusoftComplianceTestings ,tNeusoftComplianceTesting);
    }


    /**
     * 保存
     */
    @ApiOperation(value="保存" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/save")
    public TNeusoftComplianceTestingEntity save(@RequestBody TNeusoftComplianceTestingEntity tNeusoftComplianceTesting){
		tNeusoftComplianceTestingService.insert(tNeusoftComplianceTesting);
        return tNeusoftComplianceTesting;
    }

    /**
     * 处置
     */
    @ApiOperation(value="处置" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/deal")
    public TNeusoftComplianceTestingEntity update(@RequestBody TNeusoftComplianceTestingEntity tNeusoftComplianceTesting) throws Exception {
		tNeusoftComplianceTestingService.deal(tNeusoftComplianceTesting);
        return tNeusoftComplianceTesting;
    }

    /**
     * 删除
     */
    @ApiOperation(value="删除" ,httpMethod =RequestMethod.DELETE )
    @RequestMapping("/delete")
    public TNeusoftComplianceTestingEntity  delete( @RequestParam(required = true)  Integer id){
        TNeusoftComplianceTestingEntity  delete  = new TNeusoftComplianceTestingEntity();
        delete.setId(id);
        tNeusoftComplianceTestingService.delete(delete);
        return delete;
    }

}
